from gtts import gTTS
import pygame


def speak(text,language):
    tts = gTTS(text=text, lang=language)                
    tts.save("output.mp3")
       
    pygame.init()
    pygame.mixer.init()
    pygame.mixer.music.load("output.mp3")
    pygame.mixer.music.play()


if __name__ == "__main__":
    text = "hello, this is a test."
    #speak(text, 1)
    
